What is Python?
What is Python?
Python is a high-level, structured programming language ideally suited to rapid application development and scripting. It's designed to use relatively simple, readable syntax (unlike C++), making Python-based software easy to update, and application code less frustrating to understand. The creators of Python often refer to it as an ideal "glue language"; while an application written in Python executes slower than C++ and Java, it also takes between 3 and 10 times less code to write it. As a result, bridges between Java or C++ elements that don't rely on speed are often best written in Python, where they can be quickly constructed and easily modified in the future.
Who uses Python?
Due to the aforementioned speed differences between Python and its lower-level counterparts, the language is rarely used to develop large applications from the ground up. However, Python is often the language of choice for various application components and "bridges", especially with web programming. YouTube, for instance, is written predominantly in PHP, displays videos via Adobe's Flash, but has a Python based back-end. EVE-Online, a massively multiplayer online game, manages as many as 10,000 simultaneous players, a testament to the language's surprising power. NASA, Google, and Industrial Light & Magic are also devoted users of the language, often finding it the easiest and most economical way to expand on their existing software.
In addition, ESRI, the developer of the ArcGIS geographic information system, has recommended Python as the language of choice for writing add-ons and geoprocessing scripts within their software. In any scriptable, extendable piece of analysis software – such as ArcGIS -- you’ll often find yourself doing the same thing over and over again with different data. In the case of ArcGIS, this could be spatial analysis, clipping, overlay, or any number of functions. Since ArcGIS supports scripting, this process can be automated by writing a simple, small program – and with it’s combination of development speed and ease of debugging, ESRI has decided Python is the perfect language to write it in.
ArcGIS scripting is still fairly new, but it reflects a much larger general trend of “extendable” software products, all of which are suited towards the kind of low-cost, rapid development programming environment Python provides. Between the explosion of modern, platform-agnostic web applications and the emerging importance of high-level scripting, Python skills are in consistently in demand.
What are some of the advantages of Python?
1. Development Time - Python sacrifices some performance for the sake of the developer -- the result is a language ideal for small bits of code designed to extend existing software. Python, for instance, doesn't declare its variables beforehand, as lower-level languages like Java do. Although there's a performance hit (the application has to figure out what each variable is while executing, instead of knowing ahead of time, as in Java), there's also significantly less code to write. That means for non-performance intensive coding, Python has the potential to be huge time-saver in development, testing, and future maintenance releases.
2. Readable Syntax - Again, since Python is not designed for pure speed, it has the luxury of using eminently readable syntax. C++ is notorious for its many "curly braces" and other difficult to read elements -- finding a mistake in C++ code is just short of a nightmare for many. Python, however, is designed to be a bit more like English, and along with the lighter volume of code, aims to create a faster and altogether less frustrating debugging experience.
3. Compatibility - Python is all over the web in bits and pieces, primarily because it is easy to write in, but also because it's compatible with just about everything, including Windows, Linux/Unix, Mac OSX, OS/2, the Amiga, Nokia's portable phones, the Palm OS, and virtual machines including Java and .NET.
Of course, Python isn't magic 0- it's a programming language, and "garbage-in, garbage-out" still applies. But clean, well structured C++ code still looks messy, and Python seeks to address that with its syntax style and low code volume. If you have a small project, or want to extend a current code base, and don't want to deal with the development hassles of programming in an optimized, low-level language, Python is a fantastic option -- and there are plenty of success stories at http://www.python.org.
Here are some training courses that match this article:
Writing Advanced Geoprocessing Scripts Using Python
Introduction to Geoprocessing Scripts Using Python
See All Courses For Python >